package com.yang.SpringTest.annotation.conditionalLearn;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnResource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * <p>配置类</p>
 *
 * @author By: chengxuyuanshitang
 * Package com.yang.SpringTest.annotation.conditionalLearn
 * Ceate Time 2024-03-20 14:54
 */
@Slf4j
@Configuration
//@Conditional(ConditionalDemoCondition.class)
@ConditionalOnResource(resources = "classpath:conditional.properties")
public class ConditionalDemoConfig {
    @Bean
    public ConditionalDemo demo() {
        log.info("------------- ConditionalDemo init -------------");
        return new ConditionalDemo();
    }
}
